package Eyjafjalla.card.status;

import Eyjafjalla.action.CloudReflectionAction;
import Eyjafjalla.action.RetainCloudAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.card.skill.Marshmallow_Eyjafjalla;
import Eyjafjalla.modcore.EyjafjallaTag;
import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

public class Cloud_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "Cloud_Eyjafjalla";
    private static final CardStrings cardStrings;

    public Cloud_Eyjafjalla(){
        super(ID, cardStrings.NAME,0,cardStrings.DESCRIPTION,CardType.STATUS,CardColor.COLORLESS,CardRarity.SPECIAL,CardTarget.NONE);
        this.exhaust = true;
        this.selfRetain = true;
        tags.add(EyjafjallaTag.RETAIN_EYJAFJALLA);
    }

    @Override
    public AbstractCard makeCopy() {
        return new Cloud_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        if(inCloud()){
            addToBot(new CloudReflectionAction(upgraded));
        }
        else {
            addToBot(new DrawCardAction(upgraded?2:1));
        }
    }

    @Override
    public boolean canUpgrade() {
        return !this.upgraded;
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            rawDescription = cardStrings.UPGRADE_DESCRIPTION;
            initializeDescription();
        }
    }

    @Override
    public void onRetained() {
        addToBot(new RetainCloudAction(this));
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}






